package com.bird.设计模式.结构型.装饰者模式.v2;

/**
 * @data 2022/3/14 17:45
 * @author: bird
 * @description: 装饰者模式角色之三: 抽象的装饰类
 * 抽象装饰
 */
public abstract class AbstractDecorator extends AbstractBatteryCake {

    // 注入抽象实体类
    private AbstractBatteryCake abstractBatteryCake;

    // 构造器
    public AbstractDecorator(AbstractBatteryCake abstractBatteryCake) {
        this.abstractBatteryCake = abstractBatteryCake;
    }

    @Override
    protected String getDesc() {
        return this.abstractBatteryCake.getDesc();
    }

    @Override
    protected int cost() {
        return this.abstractBatteryCake.cost();
    }
}
